package com.alpha.redis.test;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;


@Service
public class DemoService {
	 @Cacheable(value = "usercache",keyGenerator = "wiselyKeyGenerator")  
	    public RUser findUser(Long id,String firstName,String lastName){  
	        System.out.println("无缓存的时候调用这里");  
	        return new RUser(id,firstName,lastName);  
	    }  
	    @Cacheable(value = "addresscache",keyGenerator = "wiselyKeyGenerator")  
	    public Address findAddress(Long id,String province,String city){  
	        System.out.println("无缓存的时候调用这里");  
	        return new Address(id,province,city);  
	    } 
}
